﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LeEdu.Service
{
    using LeEdu.DAL.DataAccess;
    using LeEdu.Entity;

    /// <summary>
    /// 试题服务类
    /// </summary>
    public class QuestionsService
    {

        private IDAL.IQuestionsDAL dal;

        public QuestionsService()
        {
            dal = new QuestionsDAL();
        }


        /// <summary>
        /// 添加试题
        /// </summary>
        /// <param name="question"></param>
        /// <returns></returns>
		public bool Add(Questions question)
        {
            return dal.Add(question);
        }

		/// <summary>
		/// 删除试题
		/// </summary>
		/// <param name="id"></param>
		/// <returns></returns>
		public bool Del(int id) {
			return dal.Del(id);
		}

		/// <summary>
		/// 编辑试题
		/// </summary>
		/// <param name="quest"></param>
		/// <returns></returns>
		public bool Edit(Questions question) {
			return dal.Edit(question);
		}

		/// <summary>
		/// 试题显示
		/// </summary>
		/// <returns></returns>
		public IEnumerable<Questions> GetAllQuestion(int id) {
			return dal.GetAllQuestion(id);
		}

		/// <summary>
		/// 获取试题数量
		/// </summary>
		/// <returns></returns>
		public int GetQuestionCount() {
			return dal.GetQuestionCount();
		}
    }
}
